﻿CREATE VIEW [acms].[UserRole_View]
AS 
	SELECT 
		a.Id, 
		a.UserId,
		b.UserName,
		b.FirstName,
		b.LastName,
		a.RoleId,
		c.Name as RoleName,
		c.IsAdminRole,
		a.SiteId,
		a.Created,
		a.Start,
		a.[End],
		a.ConcurencyId
	FROM [UserRole] a
		inner join [Users] b on a.UserId = b.Id
		inner join Role c on a.RoleId = c.Id
	where b.Deleted = 0
;